<!--
 * @Author: ykr
 * @Date: 2023-12-27 10:06:17
 * @LastEditors: ykr
 * @LastEditTime: 2024-01-09 17:03:26
 * @FilePath: \zmglpt-ui-mobile-v1.1\dev\service\supervision\detail.vue
-->
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
		<theme-navbar :is-white="false" :title="title" :custom-back="goBack" style="z-index: 99999"></theme-navbar>
		<!-- #endif -->
		<view class="content">
			<u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            标题
          </view>
          <view class="msg-context">
            {{ materialInfo.materialTitle || "/" }}
          </view>
        </u-col>
      </u-row>
			<u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            姓名
          </view>
          <view class="msg-context">
            {{ materialInfo.personName || "/" }}
          </view>
        </u-col>
      </u-row>
			<u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            单位
          </view>
          <view class="msg-context">
            {{ materialInfo.compName || "/" }}
          </view>
        </u-col>
      </u-row>
			<u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            提交日期
          </view>
          <view class="msg-context">
            {{ materialInfo.sumbitDate || "/" }}
          </view>
        </u-col>
      </u-row>
			<u-row gutter="16" align="top" class="divided-line">
        <u-col span="12">
          <view class="msg-title">
            附件
          </view>
          <view class="msg-context">
						<attachment-upload :materialUuid="materialUuid"></attachment-upload>
          </view>
        </u-col>
      </u-row>
		</view>
  </view>
</template>

<script>
import MescrollMoreMixin from "@/components/mescroll-uni/mixins/mescroll-more.js";
import superviseService from '@/service/supervision/supervision.service.js';
import attachmentUpload from "./attachmentUpload"
export default {
  mixins: [ MescrollMoreMixin ],
	components:{
    attachmentUpload
  },
  data() {
    return {
      title:'促销品监管',
			materialInfo: {},
			materialUuid: ''
    };
  },
  onLoad(opt){
		this.materialUuid = opt.materialUuid
    this.judgmentInit(opt)
		this.getMaterialDetail(this.materialUuid)
  },
  methods: {
    judgmentInit(opt) {
			this.title = '';
			switch (Number(opt.type)) {
					case 1:
						this.title = '促销品监管详情';
						break;
					case 2:
						this.title = '物流配送监管详情';
						break;
					case 3:
						this.title = '取货点监管详情';
						break;
          case 4:
						this.title = '日常监管详情';
						break;
					default:
						break;
			}
			this.updateMixinTitle(this.title);
		},
		getMaterialDetail (id) {
			this.$u.loading('正在加载...');
			superviseService.getMaterialFind({id: id}).then(res => {
				this.$u.hideLoading();
				if (res.success) {
					this.materialInfo = res.bean
				}
			}).catch(err => {
        this.$u.hideLoading();
        this.$u.toast(err);
      })
		}
  }
};
</script>

<style lang="scss" scoped>
	.content{
		padding: 0px 16px 5px 16px;
    margin: 5px 0px;
    background-color: #fff;
	}
	.divided-line{
		margin: 0px 0px 11px 0px; 
	}
	.divided-line::after{
		border-bottom: 1px solid #cccccc;
    content: "";
    width: 100%;
    opacity: 0.5;
    display: block;
	}
	.msg-title{
		font-size: 16px;
    color: #717579;
    display: inline;
	}
	.msg-context{
		font-size: 16px;
    padding: 11px 0px;
    word-break: break-all;
	}
</style>